/**
 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.crossriver.crgis.database.model.impl;

import com.crossriver.crgis.database.model.Supporting_Document;
import com.crossriver.crgis.database.model.Supporting_DocumentModel;
import com.crossriver.crgis.database.model.Supporting_DocumentSoap;

import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.impl.BaseModelImpl;

import java.io.Serializable;

import java.lang.reflect.Proxy;

import java.sql.Types;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * The base model implementation for the Supporting_Document service. Represents a row in the &quot;CRGIA_Supporting_Document&quot; database table, with each column mapped to a property of this class.
 *
 * <p>
 * This implementation and its corresponding interface {@link com.crossriver.crgis.database.model.Supporting_DocumentModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link Supporting_DocumentImpl}.
 * </p>
 *
 * <p>
 * Never modify or reference this class directly. All methods that expect a supporting_ document model instance should use the {@link com.crossriver.crgis.database.model.Supporting_Document} interface instead.
 * </p>
 *
 * @author Wole Adetiba
 * @see Supporting_DocumentImpl
 * @see com.crossriver.crgis.database.model.Supporting_Document
 * @see com.crossriver.crgis.database.model.Supporting_DocumentModel
 * @generated
 */
public class Supporting_DocumentModelImpl extends BaseModelImpl<Supporting_Document>
	implements Supporting_DocumentModel {
	public static final String TABLE_NAME = "CRGIA_Supporting_Document";
	public static final Object[][] TABLE_COLUMNS = {
			{ "documentId", new Integer(Types.VARCHAR) },
			{ "applicationId", new Integer(Types.VARCHAR) },
			{ "userId", new Integer(Types.VARCHAR) },
			{ "fileName", new Integer(Types.VARCHAR) },
			{ "documentName", new Integer(Types.VARCHAR) },
			{ "required", new Integer(Types.VARCHAR) },
			{ "documentType", new Integer(Types.VARCHAR) },
			{ "documentUpload", new Integer(Types.VARCHAR) },
			{ "uploadedDate", new Integer(Types.TIMESTAMP) }
		};
	public static final String TABLE_SQL_CREATE = "create table CRGIA_Supporting_Document (documentId VARCHAR(75) not null primary key,applicationId VARCHAR(75) null,userId VARCHAR(75) null,fileName VARCHAR(75) null,documentName VARCHAR(75) null,required VARCHAR(75) null,documentType VARCHAR(75) null,documentUpload VARCHAR(75) null,uploadedDate DATE null)";
	public static final String TABLE_SQL_DROP = "drop table CRGIA_Supporting_Document";
	public static final String ORDER_BY_JPQL = " ORDER BY supporting_Document.documentId ASC";
	public static final String ORDER_BY_SQL = " ORDER BY CRGIA_Supporting_Document.documentId ASC";
	public static final String DATA_SOURCE = "liferayDataSource";
	public static final String SESSION_FACTORY = "liferaySessionFactory";
	public static final String TX_MANAGER = "liferayTransactionManager";
	public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.entity.cache.enabled.com.crossriver.crgis.database.model.Supporting_Document"),
			true);
	public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.finder.cache.enabled.com.crossriver.crgis.database.model.Supporting_Document"),
			true);

	/**
	 * Converts the soap model instance into a normal model instance.
	 *
	 * @param soapModel the soap model instance to convert
	 * @return the normal model instance
	 */
	public static Supporting_Document toModel(Supporting_DocumentSoap soapModel) {
		Supporting_Document model = new Supporting_DocumentImpl();

		model.setDocumentId(soapModel.getDocumentId());
		model.setApplicationId(soapModel.getApplicationId());
		model.setUserId(soapModel.getUserId());
		model.setFileName(soapModel.getFileName());
		model.setDocumentName(soapModel.getDocumentName());
		model.setRequired(soapModel.getRequired());
		model.setDocumentType(soapModel.getDocumentType());
		model.setDocumentUpload(soapModel.getDocumentUpload());
		model.setUploadedDate(soapModel.getUploadedDate());

		return model;
	}

	/**
	 * Converts the soap model instances into normal model instances.
	 *
	 * @param soapModels the soap model instances to convert
	 * @return the normal model instances
	 */
	public static List<Supporting_Document> toModels(
		Supporting_DocumentSoap[] soapModels) {
		List<Supporting_Document> models = new ArrayList<Supporting_Document>(soapModels.length);

		for (Supporting_DocumentSoap soapModel : soapModels) {
			models.add(toModel(soapModel));
		}

		return models;
	}

	public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps.get(
				"lock.expiration.time.com.crossriver.crgis.database.model.Supporting_Document"));

	public Supporting_DocumentModelImpl() {
	}

	public String getPrimaryKey() {
		return _documentId;
	}

	public void setPrimaryKey(String pk) {
		setDocumentId(pk);
	}

	public Serializable getPrimaryKeyObj() {
		return _documentId;
	}

	public String getDocumentId() {
		if (_documentId == null) {
			return StringPool.BLANK;
		}
		else {
			return _documentId;
		}
	}

	public void setDocumentId(String documentId) {
		_documentId = documentId;
	}

	public String getApplicationId() {
		if (_applicationId == null) {
			return StringPool.BLANK;
		}
		else {
			return _applicationId;
		}
	}

	public void setApplicationId(String applicationId) {
		_applicationId = applicationId;
	}

	public String getUserId() {
		if (_userId == null) {
			return StringPool.BLANK;
		}
		else {
			return _userId;
		}
	}

	public void setUserId(String userId) {
		_userId = userId;
	}

	public String getFileName() {
		if (_fileName == null) {
			return StringPool.BLANK;
		}
		else {
			return _fileName;
		}
	}

	public void setFileName(String fileName) {
		_fileName = fileName;
	}

	public String getDocumentName() {
		if (_documentName == null) {
			return StringPool.BLANK;
		}
		else {
			return _documentName;
		}
	}

	public void setDocumentName(String documentName) {
		_documentName = documentName;
	}

	public String getRequired() {
		if (_required == null) {
			return StringPool.BLANK;
		}
		else {
			return _required;
		}
	}

	public void setRequired(String required) {
		_required = required;
	}

	public String getDocumentType() {
		if (_documentType == null) {
			return StringPool.BLANK;
		}
		else {
			return _documentType;
		}
	}

	public void setDocumentType(String documentType) {
		_documentType = documentType;
	}

	public String getDocumentUpload() {
		if (_documentUpload == null) {
			return StringPool.BLANK;
		}
		else {
			return _documentUpload;
		}
	}

	public void setDocumentUpload(String documentUpload) {
		_documentUpload = documentUpload;
	}

	public Date getUploadedDate() {
		return _uploadedDate;
	}

	public void setUploadedDate(Date uploadedDate) {
		_uploadedDate = uploadedDate;
	}

	public Supporting_Document toEscapedModel() {
		if (isEscapedModel()) {
			return (Supporting_Document)this;
		}
		else {
			return (Supporting_Document)Proxy.newProxyInstance(Supporting_Document.class.getClassLoader(),
				new Class[] { Supporting_Document.class },
				new AutoEscapeBeanHandler(this));
		}
	}

	public Object clone() {
		Supporting_DocumentImpl supporting_DocumentImpl = new Supporting_DocumentImpl();

		supporting_DocumentImpl.setDocumentId(getDocumentId());

		supporting_DocumentImpl.setApplicationId(getApplicationId());

		supporting_DocumentImpl.setUserId(getUserId());

		supporting_DocumentImpl.setFileName(getFileName());

		supporting_DocumentImpl.setDocumentName(getDocumentName());

		supporting_DocumentImpl.setRequired(getRequired());

		supporting_DocumentImpl.setDocumentType(getDocumentType());

		supporting_DocumentImpl.setDocumentUpload(getDocumentUpload());

		supporting_DocumentImpl.setUploadedDate(getUploadedDate());

		return supporting_DocumentImpl;
	}

	public int compareTo(Supporting_Document supporting_Document) {
		int value = 0;

		value = getDocumentId().compareTo(supporting_Document.getDocumentId());

		if (value != 0) {
			return value;
		}

		return 0;
	}

	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}

		Supporting_Document supporting_Document = null;

		try {
			supporting_Document = (Supporting_Document)obj;
		}
		catch (ClassCastException cce) {
			return false;
		}

		String pk = supporting_Document.getPrimaryKey();

		if (getPrimaryKey().equals(pk)) {
			return true;
		}
		else {
			return false;
		}
	}

	public int hashCode() {
		return getPrimaryKey().hashCode();
	}

	public String toString() {
		StringBundler sb = new StringBundler(19);

		sb.append("{documentId=");
		sb.append(getDocumentId());
		sb.append(", applicationId=");
		sb.append(getApplicationId());
		sb.append(", userId=");
		sb.append(getUserId());
		sb.append(", fileName=");
		sb.append(getFileName());
		sb.append(", documentName=");
		sb.append(getDocumentName());
		sb.append(", required=");
		sb.append(getRequired());
		sb.append(", documentType=");
		sb.append(getDocumentType());
		sb.append(", documentUpload=");
		sb.append(getDocumentUpload());
		sb.append(", uploadedDate=");
		sb.append(getUploadedDate());
		sb.append("}");

		return sb.toString();
	}

	public String toXmlString() {
		StringBundler sb = new StringBundler(31);

		sb.append("<model><model-name>");
		sb.append("com.crossriver.crgis.database.model.Supporting_Document");
		sb.append("</model-name>");

		sb.append(
			"<column><column-name>documentId</column-name><column-value><![CDATA[");
		sb.append(getDocumentId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>applicationId</column-name><column-value><![CDATA[");
		sb.append(getApplicationId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>userId</column-name><column-value><![CDATA[");
		sb.append(getUserId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>fileName</column-name><column-value><![CDATA[");
		sb.append(getFileName());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>documentName</column-name><column-value><![CDATA[");
		sb.append(getDocumentName());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>required</column-name><column-value><![CDATA[");
		sb.append(getRequired());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>documentType</column-name><column-value><![CDATA[");
		sb.append(getDocumentType());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>documentUpload</column-name><column-value><![CDATA[");
		sb.append(getDocumentUpload());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>uploadedDate</column-name><column-value><![CDATA[");
		sb.append(getUploadedDate());
		sb.append("]]></column-value></column>");

		sb.append("</model>");

		return sb.toString();
	}

	private String _documentId;
	private String _applicationId;
	private String _userId;
	private String _fileName;
	private String _documentName;
	private String _required;
	private String _documentType;
	private String _documentUpload;
	private Date _uploadedDate;
}